<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

function smarty_function_string_from_binmask($params, &$smarty) {

//error_log($params[mask]);

		$out = array();
		if($params[mask]) {
			$i = 0;
			foreach ($params[mask] as $m) {
				if($params[from] & 1 << $i ) {
					
					$out[] = $m[description];
//					error_log($m[description]);
				}
					
				$i++;
			}
		}
		return join(', ',$out);

} 
/* vim: set expandtab: */